<style>
.fui-list-inner .row .row-text{font-size:0.7rem}
</style>
<div ng-if="pagedata.op!='fa'" class='fui-page fui-page-current'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">订单管理</div>
    </div>
    <!-- 顶部tab -->
    <div id="tab" class="fui-tab fui-tab-danger" style="margin-top:2.3rem">
			<a ng-class="{'active':pagedata.params.status==1}" ng-click="pagedata.params.status=1;tool.get_list('jy_weishop/order.list/list/',true);">待发货</a>
            <a ng-class="{'active':pagedata.params.status==0}" ng-click="pagedata.params.status=0;tool.get_list('jy_weishop/order.list/list/',true);" >待付款</a>
            <a ng-class="{'active':pagedata.params.status==2}" ng-click="pagedata.params.status=2;tool.get_list('jy_weishop/order.list/list/',true);">待收货</a>
            <a ng-class="{'active':pagedata.params.status==3}" ng-click="pagedata.params.status=3;tool.get_list('jy_weishop/order.list/list/',true);">已完成</a>
            <a ng-class="{'active':pagedata.params.status==4}" ng-click="pagedata.params.status=4;tool.get_list('jy_weishop/order.list/list/',true);">已关闭</a>
    </div>
    <div class='fui-content' style="margin-top:0.5rem">
		<div class="searchbar" style='margin:0.3rem;padding:0'>
                    <div class="search-input">
                        <i id="searchsub" class="icon icon-search" ng-click="tool.get_list('jy_weishop/order.list/list/',true)"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="输入订单号..." style="border: 1px solid #f7f7f7;">
                    </div>
        </div>
        <!-- 订单列表 -->
        <div class="fui-list-outer container"></div>
		
        <div ng-repeat="item in pagedata.list" class="fui-list-group" >

            <a class="fui-list order-list title-b" ng-click="access_json('jy_weishop/order.detail//id='+item.id)"  data-nocache="true">
                <div class="fui-list-media">
                    <span ng-if='item.ispay==1' class="fui-label fui-label-danger round">{{pagedata.paytype[item.paytype]}}</span>
					<span ng-if='item.ispay==0' class="fui-label fui-label-danger round">未付款</span>
                </div>
                <div class="fui-list-inner">
                    <div class="row">
                        <div class="row-text" style="font-size: 0.7rem; color: #666">{{item.ordersn}}</div>
                    </div>
                    <div class="row gary">
                        <div class="row-text">{{item.createtime}}</div>
                    </div>
                </div>
                <div class="angle"></div>
            </a>           
                <div ng-repeat="m in item.merchs">
						<a href="javascript:;" ng-repeat="g in m.goods" class="external" data-nocache="true" ng-click="access_json('jy_weishop/order.detail//id='+item.id)">
							<div class="fui-list goods-list" style="background:#fff">
								<div class="fui-list-media" style="">
									<img class="" ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}">
								</div>
								<div class="fui-list-inner">
									<div class="text goodstitle towline">{{g.title}}</div>
									<div class="text" style="color:#f60;font-size:0.50rem">{{g.selespename || '无规格'}} x {{g.total || 1}}</div>
									<div class="text"><i class="fui-tag fui-tag-red">{{item.buytypetitle}}</i></div>
								</div>
								<div class="fui-list-angle" style="width:3rem">
									￥<span class="marketprice">{{g.price}}</span></div>
							</div>
						</a>
					</div>
           
            <div class="fui-list log-list noclick">
                <div class="fui-list-inner">
                    <div class="row log-row order">
                        <div class="row-text">订单状态</div>
                        <div class="row-remark"><span class="text-danger">{{check_show_lang(pagedata.status[item.status])}}</span></div>
                    </div>
                    <div class="row log-row order">
                        <div class="row-text">买家昵称</div>
                        <div class="row-remark">{{item.member.nickname}}</div>
                    </div>
                    <div class="row log-row order">
                        <div class="row-text">配送方式</div>
                        <div class="row-remark"><span class="text-success">{{pagedata.sendtype[item.sendtype]}}</span></div>
                    </div>
                   
                        <div ng-if="item.remark" class="row log-row order">
                            <div class="row-text">买家留言</div>
                            <div class="row-remark">{{item.remark}}</div>
                        </div>
                  
                </div>
            </div>

            <div class="fui-list-group-title text-right">
                <small class="status">共<span class="text-success">{{item.total}}</span>个商品 实付:<span class="text-success">￥{{item.price}}</span> </small>
            </div>
			<div ng-if="item.address" class="fui-list-group-title lineblock" style="line-height:1rem;padding:0 0.5rem">
				<span style="line-height:1.3;color:#999;font-size:0.65rem"><i class="icon icon-ditu"></i> 配送： <span class="text-danger">{{item.address}}</span></span>
			</div>
            <div class="fui-list-group-title text-right big">
                <!-- 未付款 -->
                <!-- 已付款 -->
				<a ng-if="item.status==1" ng-click="access_json('jy_weishop/order.list/fa/id='+item.id)" class="btn btn-success btn-sm order-btn" data-action="send">{{item.sendtype==1?'确认发货':'自提核销'}}</a>
                <a ng-if="item.status==2" ng-click="post({},'jy_weishop/order.list/shou/','id='+item.id)" class="btn btn-success btn-sm order-btn" data-action="sendcancel">确认收货</a>
                <a class="btn btn-default btn-sm" ng-click="access_json('jy_weishop/order.detail//id='+item.id)">查看详情</a>
            </div>
        </div>
       <div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有订单！</p>
	</div>
    </div>
    <div class="head-menu-mask"></div>
</div>
<div ng-if="pagedata.op=='fa'" class='fui-page fui-page-current'>
    <div class="fui-header fui-header-success">
        <div class="fui-header-left">        
        </div>
        <div class="title">发货</div>
        <div class="fui-header-right"></div>
    </div>
    <div class='fui-content'>
        <div class="fui-cell-group">
            <div class="fui-cell ">
                <div class="fui-cell-label ">快递公司</div>
                <div class="fui-cell-info">
                    <select class="weui_select" name="select2" ng-model="pagedata.item.express">
                        <option ng-repeat="f in pagedata.express" value="{{f.id}}">{{f.name}}</option>
                    </select>
                <div class="fui-cell-remark"></div>
                </div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">快递单号</div>
                <div class="fui-cell-info">
                    <input type="text" placeholder="请输入快递单号" class="fui-input" ng-model="pagedata.item.expresssn"   id="subtitle" />
                </div>
            </div>
        </div>
		<div class="btn btn-success block" ng-click="post(pagedata.item,'jy_weishop/order.list/fa/')">确定</div>
	</div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});

scope.loading = true;
var page = 1;
var keyword = '';
var op = '';
op = scope.pagedata.op;
scope.tool.get_list('jy_weishop/order.list/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/order.list/list/');
}
</script>
